﻿using System.Configuration;

namespace TogNet.Configuration
{
    public class NetworkAdapterCollection : ConfigurationElementCollection
    {
        public NetworkAdapter this[int index]
        {
            get
            {
                return BaseGet(index) as NetworkAdapter;
            }
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new NetworkAdapter();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((NetworkAdapter) element).Name;
        }

        public void Add(NetworkAdapter adapter)
        {
            BaseAdd( adapter );
        }

        public void Clear()
        {
            BaseClear();
        }
    }
}